<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	
	<body>
		
	</body>
	
	<script>
		//
		//0101011010101010101011111001
		
		//13532 ===> 1X10^4 + 3X10^3 + 5X10^2 + 3X10^1 + 2X10^0
		
		//0000 1100
		  
		//十进制转二进制
		var n = 255;
		console.log(n.toString(2));
		console.log(n.toString(16));	
		
		//二进制转十进制
		var n = "101";
		console.log( parseInt(n,2) );
	</script>
	
	
</html>



